package com.wangsh.splider.task.pojo;

import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

import com.wangsh.splider.common.pojo.BasePojo;
import com.wangsh.splider.orders.pojo.AOrdersUsers;
import com.wangsh.splider.system.pojo.ASysMailAccount;

public class ATaskUsers extends BasePojo<ATaskUsers> {
	private int id;
	private int taskId;
	private int ordersUsersId;
	private int mailAccountId ; 
	private String email;
	private String phone;
	private String mailName;
	private int viewNum;
	private int clickNum;
	private byte status;
	private Date createTime;
	private Date updateTime;
	private Date pubTime;

	// 关联关系
	private ATaskDesc desc;
	private AOrdersUsers ordersUsers;
	private ASysMailAccount mailAccount ; 

	/*--字符串表示--*/
	private String statusStr;
	/* 存储所有状态的容器 */
	private Map<String, String> enumsMap = new TreeMap<String, String>();

	public Map<String, String> getEnumsMap() {
		// 根据状态值获取字符串描述
		ATaskUsersEnum[] taskUsersEnums = ATaskUsersEnum.values();
		for (int i = 0; i < taskUsersEnums.length; i++) {
			ATaskUsersEnum taskUsersEnum = taskUsersEnums[i];
			String key = taskUsersEnum.toString();
			if (key.lastIndexOf("_") != -1) {
				key = key.substring(0, key.lastIndexOf("_"));
			}
			enumsMap.put(key + "-" + taskUsersEnum.getStatus() + "", taskUsersEnum.getName());
		}
		return enumsMap;
	}

	public String getStatusStr() {
		// 根据状态值获取字符串描述
		ATaskUsersEnum[] taskUsersEnums = ATaskUsersEnum.values();
		for (int i = 0; i < taskUsersEnums.length; i++) {
			ATaskUsersEnum taskUsersEnum = taskUsersEnums[i];
			if (taskUsersEnum.toString().startsWith("STATUS_")) {
				// 表示是状态的标识
				if (taskUsersEnum.getStatus() == this.getStatus()) {
					this.statusStr = taskUsersEnum.getName();
					break;
				}
			}
		}
		return statusStr;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getTaskId() {
		return taskId;
	}

	public void setTaskId(int taskId) {
		this.taskId = taskId;
	}

	public int getOrdersUsersId() {
		return ordersUsersId;
	}

	public void setOrdersUsersId(int ordersUsersId) {
		this.ordersUsersId = ordersUsersId;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getMailName()
	{
		return mailName;
	}

	public void setMailName(String mailName)
	{
		this.mailName = mailName;
	}

	public int getViewNum() {
		return viewNum;
	}

	public void setViewNum(int viewNum) {
		this.viewNum = viewNum;
	}

	public int getClickNum() {
		return clickNum;
	}

	public void setClickNum(int clickNum) {
		this.clickNum = clickNum;
	}

	public byte getStatus() {
		return status;
	}

	public void setStatus(byte status) {
		this.status = status;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Date getPubTime() {
		return pubTime;
	}

	public void setPubTime(Date pubTime) {
		this.pubTime = pubTime;
	}

	public ATaskDesc getDesc() {
		return desc;
	}

	public void setDesc(ATaskDesc desc) {
		this.desc = desc;
	}

	public AOrdersUsers getOrdersUsers() {
		return ordersUsers;
	}

	public void setOrdersUsers(AOrdersUsers ordersUsers) {
		this.ordersUsers = ordersUsers;
	}

	public int getMailAccountId()
	{
		return mailAccountId;
	}

	public void setMailAccountId(int mailAccountId)
	{
		this.mailAccountId = mailAccountId;
	}

	public ASysMailAccount getMailAccount()
	{
		return mailAccount;
	}

	public void setMailAccount(ASysMailAccount mailAccount)
	{
		this.mailAccount = mailAccount;
	}
}
